Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 4b819238a3735320c78eefb0ee6134afc2dc01c6


Parents : 419d5a9
Author : Mark Qvist <mark@unsigned.io>
Date : 2022-09-14T21:34:21+02:00

Improved startup when TCP peer is unreachable

Changes

4 files changed, 56 insertions(+), 9 deletions(-)

M sbapp/main.py +9 -5
M setup.py +1 -1

Diff

diff --git a/sbapp/main.py b/sbapp/main.py
index 09466ae3..82c7d112 100644
--- a/sbapp/main.py
+++ b/sbapp/main.py
@@ -5,6 +5,7 @@ import sys
import os
from kivy.logger import Logger, LOG_LEVELS
+# Logger.setLevel(LOG_LEVELS["debug"])
Logger.setLevel(LOG_LEVELS["error"])
if RNS.vendor.platformutils.get_platform() != "android":
@@ -39,7 +40,7 @@ from kivy.metrics import dp
from kivymd.uix.button import MDFlatButton
from kivymd.uix.dialog import MDDialog
-__version__ = "0.1.8"
+__version__ = "0.1.9"
__variant__ = "beta"
if RNS.vendor.platformutils.get_platform() == "android":
@@ -52,6 +53,7 @@ class SidebandApp(MDApp):
self.title = "Sideband"
self.sideband = SidebandCore(self)
+
self.conversations_view = None
self.flag_new_conversations = False
@@ -64,15 +66,18 @@ class SidebandApp(MDApp):
Window.softinput_mode = "below_target"
self.icon = self.sideband.asset_dir+"/images/icon.png"
+ def start_core(self, dt):
+ self.sideband.start()
+ self.open_conversations()
+ Clock.schedule_interval(self.jobs, 1)
+
#################################################
# General helpers #
#################################################
def build(self):
FONT_PATH = self.sideband.asset_dir+"/fonts"
- # self.theme_cls.primary_palette = "Green"
self.theme_cls.theme_style = "Dark"
- # self.theme_cls.theme_style = "Light"
screen = Builder.load_string(root_layout)
return screen
@@ -132,9 +137,8 @@ class SidebandApp(MDApp):
self.root.ids.screen_manager.app = self
self.root.ids.app_version_info.text = "Sideband v"+__version__+" "+__variant__
- self.open_conversations()
- Clock.schedule_interval(self.jobs, 1)
+ Clock.schedule_once(self.start_core, 3)
# Part of the focus hack fix
def android_focus_fix(self, sender, val):

diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py
index 8ec8c0b8..ffafc869 100644
--- a/sbapp/sideband/core.py
+++ b/sbapp/sideband/core.py
@@ -120,9 +120,7 @@ class SidebandCore():
RNS.Transport.register_announce_handler(self)
RNS.Transport.register_announce_handler(self.propagation_detector)
-
- self.start()
-
+
def __init_config(self):
RNS.log("Creating new Sideband configuration...")

diff --git a/sbapp/ui/layouts.py b/sbapp/ui/layouts.py
index 0eb5211a..eeaf0d67 100644
--- a/sbapp/ui/layouts.py
+++ b/sbapp/ui/layouts.py
@@ -1,8 +1,53 @@
root_layout = """
+#: import NoTransition kivy.uix.screenmanager.NoTransition
+#: import SlideTransition kivy.uix.screenmanager.SlideTransition
+
MDNavigationLayout:
ScreenManager:
id: screen_manager
+ # transition: SlideTransition()
+ transition: NoTransition()
+
+ MDScreen:
+ name: "starting_screen"
+
+ AnchorLayout:
+ anchor_x: "center"
+ anchor_y: "center"
+ padding: dp(64)
+
+
+ BoxLayout:
+ spacing: dp(36)
+ orientation: 'vertical'
+ size_hint_y: None
+
+ MDLabel:
+ id: connecting_info
+ halign: "center"
+ text: "Please Wait"
+ font_size: "32dp"
+ size_hint_y: None
+ text_size: self.width, None
+ height: self.texture_size[1]
+ # size: self.texture_size
+
+ MDIconButton:
+ pos_hint: {"center_x": .5, "center_y": .5}
+ icon: "transit-connection-variant"
+ user_font_size: "72dp"
+
+ MDLabel:
+ id: connecting_info
+ halign: "center"
+ text: "Substantiating Reticulum"
+ font_size: "32dp"
+ size_hint_y: None
+ text_size: self.width, None
+ height: self.texture_size[1]
+ # size: self.texture_size
+
MDScreen:
name: "conversations_screen"

diff --git a/setup.py b/setup.py
index 241302d6..dd1ded69 100644
--- a/setup.py
+++ b/setup.py
@@ -58,6 +58,6 @@ setuptools.setup(
'sideband=sbapp:main.run',
]
},
- install_requires=['rns>=0.3.11', 'lxmf>=0.1.7', 'kivy==2.1.0', 'plyer'],
+ install_requires=['rns>=0.3.12', 'lxmf>=0.1.7', 'kivy==2.1.0', 'plyer'],
python_requires='>=3.6',
)


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────